
#ifndef __MYIIC_H__
#define __MYIIC_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/event_groups.h"
#include "freertos/queue.h"
#include "esp_freertos_hooks.h"
#include "freertos/semphr.h"
#include "esp_system.h"

#include <errno.h>
#include "esp_err.h"
#include "esp_log.h"



esp_err_t my_iic_init(void);
//读1个字节
esp_err_t my_iic_read_byte(uint8_t dev_addr,uint8_t mem_address, uint8_t *data);
//读n个字节
esp_err_t my_iic_read_bytes(uint8_t dev_addr,uint8_t mem_address, size_t data_len, uint8_t *data);
//写1个字节
esp_err_t my_iic_write_byte(uint8_t dev_addr,uint8_t mem_address, uint8_t data);
//写n个字节
esp_err_t my_iic_write_bytes(uint8_t dev_addr,uint8_t mem_address, size_t data_len, const uint8_t *data);

esp_err_t my_iic_write_byte1(uint8_t dev_addr, uint8_t data);
esp_err_t my_iic_read_nbytes(uint8_t dev_addr, size_t data_len, uint8_t *data);
esp_err_t my_iic_read_byte1(uint8_t dev_addr, uint8_t *data);
#ifdef __cplusplus
}
#endif
#endif /* __MYIIC_H__ */
